<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" type="text/css" href="<%=path %>/static/css/css.css?1" />
<link rel="stylesheet" type="text/css" href="<%=path %>/static/jquery-ui/jquery-ui.min.css" />
<script type="text/javascript" src="<%=path %>/static/js/json2.js"></script>
<script type="text/javascript" src="<%=path %>/static/js/jquery.js"></script>
<script type="text/javascript" src="<%=path %>/static/jquery-ui/jquery-ui.min.js"></script>
<script type="text/javascript" src="<%=path %>/static/layer/layer.js"></script>
<script type="text/javascript" src="<%=path %>/static/js/gridview.js?v=1"></script>
<script type="text/javascript" src="<%=path %>/static/js/formview.js?v=1"></script>
<script type="text/javascript" src="<%=path %>/static/js/tool.js"></script>
<script type="text/javascript" src="<%=path %>/static/js/validate.js"></script>
<SCRIPT type="text/javascript">
    <!--
    var formSetting0 = {
    		po:'TaxAccessLog',
    		type:"query",
    		hiddens:["id"],
    	fields:[[{title:"设备",type:"text",name:"device"}
    	  ]
    	],
    	queryRow:{align:'center',buttons:[
		                 			   {
		                 			    	 id:'query',
		                 			    	 title:'查询',
		                 			    	 handlers:{
		                 			    		 click: function(e,queryForm){
		                 			    			 queryData(e,queryForm);
		                 			    		 }
		                 			    	 }
		                 			     }, {
		                 			    	 id:'resetbtn',
		                 			    	 title:'重置',
		                 			    	 handlers:{
		                 			    		 click: function(){
		                 			    			 form0.reset();
		                 			    		 }
		                 			    	 }
		                 			     }
		                 			 ]}
    }

    function queryData(e,queryForm){
    	var Device = queryForm.find(":input[name=device]").val();

    	var data = [];
    	if(Device!==""){
    		data.push({r:"like",name:'device',value:"%"+Device+"%"});
    	}

    	grid.load({data:data});
    	ajustHeight();
    }
	var gridSetting = {
			id:'taxAccessLogGrid',
			po:"TaxAccessLog",
			title:'日志列表',
			height:'auto',
			service:"uiServices!listSimple",
			tbId:"advTb",
			pageInfo: {
				records: 12,//auto表示根据容器高度自动判断
				orderby : "id desc"
			},
			fields:[
			   {	name:'id',
					hide:true
			   },{
				   name: 'ip',
				   descs:"IP",
				   align:'left'
			   },{
                   name: 'device',
                   descs:"设备",
                   align:'left'
               }
               ,{
                   name: 'createDateTime',
                   descs:"访问时间",
                   align:'center',
                   width:140,
                   type:'date'
               }
			],
			toolbar:{align:'right',buttons:[

            		                 		 {
            		                 			    	 id:'delete',
            		                 			    	 title:'删除',
            		                 			    	 handlers:{
            		                 			    		 click: function(){
            		                 			    			 grid.deletes("deleteMappedRoleNavis",function(ret){
            		                 			    				 if(ret==-1){
            		                 			    					 layer.msg("删除失败，请重试！");
            		                 			    				 }else{
            		                 			    					 layer.msg("删除" + ret.recordNum + "条记录！",function(ret){
            		                 			    						 grid.reload();
            		                 			    					 });
            		                 			    				 }
            		                 			    			 });

            		                 			    		 }
            		                 			    	 }
            		                 			     }
            		                 			 ]}
		};
	var grid,form0;
    $(document).ready(function(){
    	form0 = new FormView("formview0",formSetting0);
    	form0.init();
    	grid = new GridView("list",gridSetting,"list");
		grid.init();
		var data = [];
		grid.load({data:data});

		ajustHeight();

    });


    //-->
</SCRIPT>
</head>

<body>
<div id="formview0" class="rbox1"></div>
<div id="formview" class="rbox1"></div>
<div id="list" class="rbox2"></div>
<script type="text/javascript" src="<%=path %>/static/js/underscore.js"></script>
<script type='text/javascript' src='<%=path %>/static/My97DatePicker/WdatePicker.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/engine.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/util.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/interface/BaseDwr.js'></script>
</body>
</html>